<%-- 
    Document   : ResultFlight
    Created on : Nov 2, 2011, 12:06:03 AM
    Author     : MrKoi
--%>

<%@page import="DAL.FlightsBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <style type="text/css">
            #Table
            {
            border:1px solid green;
            }
            th
            {
            border:1px solid green;
            background-color:green;
            color:white;
            }
            .td
            {
            border:1px solid green;
            }
            .font
            {
            font-family:"Times New Roman", Times, serif;
            font-size:x-large;
            font-weight:bold;
            width:200px;
            margin-left:auto;
            margin-right:auto;
            color:#0707e7;
            }
            .center
            {
                margin-top:10px;
                margin-left:auto;
                margin-right:auto;
            }
        </style>
    </head>
    <body>
        <%
        String namecity=session.getAttribute("departure").toString();
        String departure=session.getAttribute("arrival").toString();
        FlightsBean cb=new FlightsBean();
        Collection cl1=cb.SearchListFights(namecity,departure);
        request.setAttribute("lc",cl1);
        if(cl1.size()>0)
            {
        %>
    <div class="font">List Flights</div>    
        <table width="100%" id="Table">  
            <tr>
                <th>Name City</th>
                <th>Flight Name</th>
                <th>Departure Time</th>
                <th>Arrival Time</th>
                <th>Departure City</th>
                <th>Arrival City</th>
                <th>Price</th>
            </tr>
            <pg:paging pageSize="10" url="management.jsp?page=ResultFlight">
                <c:forEach items="${lc}" var="cr">
                    <pg:item>
                        <tr>
                             <td class="td">${cr.nameCity}</td>
                            <td class="td">${cr.flightName}</td>
                            <td class="td">${cr.departure_Time}</td>
                            <td class="td">${cr.arrival_Time}</td>
                            <td class="td">${cr.departure_City}</td>
                            <td class="td">${cr.arrival_City}</td>
                            <td class="td"><f:formatNumber value="${cr.price}" pattern="$#,###"/></td>
                        </tr>
                    </pg:item>       
                </c:forEach>
                <pg:index>
                    <pg:page><%=thisPage%></pg:page>
                </pg:index>
            </pg:paging>
        </table>       
        <%
        }
        else
            {
            %>
             <div class="font center">Not Found!</div>    
            <%
            }
        %>
    </body>
</html>